package resp

import (
	"github.com/gin-gonic/gin"
)

type Entity struct {
	Code      int         `json:"code"`
	Msg       string      `json:"msg"`
	Total     int         `json:"total"`
	TotalPage int         `json:"totalPage"`
	Data      interface{} `json:"data"`
}

func R(entity *Entity) gin.H {
	return gin.H{
		"Code":      entity.Code,
		"Msg":       entity.Msg,
		"Total":     entity.Total,
		"TotalPage": entity.TotalPage,
		"Data":      entity.Data,
	}
}
